#!/usr/bin/env python

# -------------------------------
# projects/python/primes/main.py
# Copyright (C) 2009
# Glenn P. Downing
# -------------------------------

# To run the program
#     main.py < Primes.in > Primes.out

# To document the program
#     pydoc -w main

# -------
# globals
# -------

x = 0 # input: don't change after reading
num1 = 0 # output
num2 = 0 # output
num3 = 0 # output
num4 = 0 # output

# -----------
# InputReader
# -----------

class InputReader (object) :
    def read (self) :
        return raw_input()

# ------------
# OutputWriter
# ------------

class OutputWriter (object) :
    def write (self, *a) :
        for w in a :
            print w,
        print

# -------
# my_read
# -------

def my_read (r) :
    """
    reads an int into x
    return true if that succeeds, false otherwise
    """
    global x
    try :
        s = r.read()
    except EOFError :
        return False
    x = int(s)
    return True

# -------
# my_eval
# -------

def my_eval () :
	"""
	checks to see if x can be written as the sum of 4 prime numbers
	returns true if it can, and stores the 4 values in num1, num2, num3, and num4
	returns false if x cannot be written as the sum of 4 primes
	"""
	global x
	global num1
	global num2
	global num3
	global num4
	
	#any number less than 8 cannot be written as a sum of 4 primes (negative numbers are excluded altogether)
	if (x <= 7) :
		return False
	
	#the first two numbers are set to either 2,2 or 2,3 depending on whether x is even or odd.
	if (x % 2 == 0) :
		num1 = 2
		num2 = 2
	
	if (x % 2 != 0) :
		num1 = 2
		num2 = 3
	
	temp = x - num1 - num2
	
	i = temp
	
	#starts at the number temp and iterates backwards.  If it finds a combination of prime numbers which add
        #up to temp, the two numbers are assigned to num3 and num4, and the method
        #terminates and returns true because 4 primes have been found that add up to x.  The method 'isPrime' is used to determine 
	#if a number is prime or not.
	while (i >= 2) :
		if (isPrime(i) == True) :
			if (isPrime(temp - i) == True) :
				num3 = temp - i
				num4 = i
				return True
		i = i - 1
	
	return False


# -------
# isPrime
# -------

def isPrime (n) :
	"""
	checks to see if n is a prime number
	returns true if n is prime, false otherwise
	
	This method was borrowed from the textbook, 
	"Data Structures and Problem Solving Using Java" by Mark Allen Weiss (p.358).  I modified it to work in Python and added some additional if-
	statements to return false if n <= 1 or if n is an even number, and another one to return true if n == 2.
	If n is odd and n >= 3, the method uses trial division to test if the number is prime.  n is prime if
	it is not divisible by any other odd number <= the square root of n (p.357).
	"""
	
	if (n <= 1) :
		return False
	
	if (n == 2) :
		return True
	
	if (n % 2 == 0) :
		return False
		
	z = 3
	
	while(z*z <= n) :
		if (n % z == 0) :
			return False
		z = z + 2
	
	return True

# --------
# my_print
# --------

def my_print (w) :
    """
    writes the values of num1, num2, num3, and num4
    """
    w.write(num1, num2, num3, num4)

# --------
# false_print
# --------

def false_print (w) :
    """
    writes "Impossible." This statement occurs when a number cannot be written as the sum of 4 prime numbers
    """
    w.write("Impossible.")
# ----
# main
# ----

def main () :
    """
    runs the program
    """
    while my_read(InputReader()) :
        if (my_eval() == True) :
        	my_print(OutputWriter())
	else :
		false_print(OutputWriter())

if __name__ == "__main__" :
    main()